﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using YiSha.Business.OrganizationManage;
using YiSha.Business.SystemManage;
using YiSha.Entity.SystemManage;
using YiSha.Enum;
using YiSha.IdGenerator;
using YiSha.Model.Result;
using YiSha.Util.Extension;
using YiSha.Web.Code;
using YiSha.Util.Model;
using YiSha.Util;
using YiSha.Entity.OrganizationManage;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using YiSha.Model.Param.OrganizationManage;

namespace YiSha.Admin.Web.Controllers
{
    public class IndexController : Controller
    {
        private MyBLL myBLL = new MyBLL();
        private MotoBLL motoBLL = new MotoBLL();
        private NewsBLL newsBLL = new NewsBLL();
        private Pagination pagination = new Pagination();
      
        public async Task<IActionResult> Index()
        {
            //获取用户 基本信息 单条
            TData<MyEntity> obj = await myBLL.GetEntity(182428040796573696);
            MyEntity mylist = obj.Result;
            ViewBag.Mylist = mylist;

            //MyInfo myInfo = new MyInfo();
            //TData<MyEntity> obj = await myBLL.GetEntity(182428040796573696);
            //myInfo.MyTitle = obj.Result.MyTitle;
            //myInfo.MyGuanjianzi = obj.Result.MyGuanjianzi;
            //myInfo.MyBanquan = obj.Result.MyBanquan;
            //myInfo.MyMiaoshu = obj.Result.MyMiaoshu;

            //myInfo.MyWangdian = obj.Result.MyWangdian;
            //myInfo.MyFuwushang = obj.Result.MyFuwushang;
            //myInfo.MyUsers = obj.Result.MyUsers;
            //myInfo.MyTel = obj.Result.MyTel;
            //myInfo.MyErweima = obj.Result.MyErweima;
            //myInfo.MyXiaochengxu = obj.Result.MyXiaochengxu;

            //ViewBag.myInfo = myInfo;


            //获取  /api/News/GetPageListJson?pageSize=10&pageIndex=1
            //MotoListParam param, Pagination pagination
            //pagination.PageSize = 10;
            //pagination.PageIndex = 1;
            //TData<List<MotoEntity>> objMoto = await motoBLL.GetPageList(null, pagination);
            //List<MotoEntity> motoList = objMoto.Result;
            //ViewBag.MotoList = motoList;
            return View();
          
        }

        public IActionResult Cont()
        {
            return View();
        }
        public async Task<IActionResult> mylist() {
            TData<MyEntity> obj = await myBLL.GetEntity(182428040796573696);
            MyEntity mylist = obj.Result;
            ViewBag.Mylist = mylist;
            return View(ViewBag.Mylist);
        }
    }
}